package com.siccr.model;

public class Airplane extends Engine {
	public String name;
	private float gasoline;
	private int id;
	private Passenger[] passengers;
	static int capacity = 2;	
	protected int seat_index = 1;
	
	public Airplane(){		
		super();
		this.passengers = new Passenger[capacity];
	}
	
	public Airplane(String name, int id) {
		super();
		this.passengers = new Passenger[capacity];
		this.name = name;
		this.id = id;
	}
	
	public Airplane(int c){
		super();
		this.passengers = new Passenger[capacity];
		Airplane.capacity = c;
	}
	
	public static boolean reviewGasoline(){
		
		return true;
	}
	
	public Airplane updateCapacity(int c){
		Airplane.capacity = c;
		return this;
	}
	
	public static int getCapacity() {
		return capacity;
	}

	public static void setCapacity(int capacity) {
		Airplane.capacity = capacity;
	}

	public void takeoff(City from, City to){
		
	}
	
	public int addPassenger(Passenger p){
		
		this.passengers[this.seat_index-1] = p;
		
		return this.passengers.length - this.seat_index++;
		
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public float getGasoline() {
		return gasoline;
	}
	public void setGasoline(float gasoline) {
		this.gasoline = gasoline;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Passenger[] getPassengers() {
		return passengers;
	}
	public void setPassengers(Passenger[] passengers) {
		this.passengers = passengers;
	}
}